package com.yzj.android.dao.impl;

import com.yzj.Bean.User;
import com.yzj.android.dao.BaseDao;
import com.yzj.android.dao.UserDao;

public class UserDaoImpl extends BaseDao implements UserDao {
    @Override
    public User queryUsernameAndPassword(String name, String password) {
        String sql = "select `id`,`username`,`password`  from c_user where username = ? and password = ?";
        return queryForOne(User.class, sql, name, password);
    }

    @Override
    public int saveUser(User user1) {
        String sql = "insert  into c_user(`username`,`password`) values(?,?)";
        return update(sql, user1.getUsername(), user1.getPassword());
    }
}
